<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    
    <title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>ext-3.2.1/resources/css/ext-all.css"/>
	<script type="text/javascript" src="<%=basePath%>ext-3.2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="<%=basePath%>ext-3.2.1/ext-all.js"></script>
	<script type="text/javascript" src="<%=basePath%>ext-3.2.1/ux/PageComboResizer.js"></script>
	<script type="text/javascript" src="<%=basePath%>ext-3.2.1/ext-lang-zh_CN.js"></script>
		
	<script type="text/javascript" src="<%=basePath%>scripts/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>scripts/apputil.js"></script>
	<script type="text/javascript" src="<%=basePath%>pages/organization/doctor.js"></script>
	<link rel="stylesheet" href="../scripts/kindeditor-4.1/themes/default/default.css" />
	<link rel="stylesheet" href="../scripts/kindeditor-4.1/plugins/code/prettify.css" />
	<script charset="utf-8" src="../scripts/kindeditor-4.1/kindeditor-min.js"></script>
	<script charset="utf-8" src="../scripts/kindeditor-4.1/lang/zh_CN.js"></script>
	<script charset="utf-8" src="../scripts/kindeditor-4.1/plugins/code/prettify.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
	  <style type="text/css">
	    body{
	    font-size: 12px;
	    
	  }
	  	.td{
			height: 25px;
		}
		.tdB {
			border-bottom:1px solid #0190FB;
		}
		
		.tdL {
			border-left:1px solid #0190FB;
		}
		
		.tdR {
			border-right:1px solid #0190FB;
		}
		
		.tdT {
			border-top:1px solid #0190FB;
		}
	</style>
	<script type="text/javascript">
		function checkForm(){
	    var name = $("#realName");
	    if (name.val()=="") {
	        alert("医生姓名不能为空！")
	        name.focus();
	        return false;
	    }
	    /*else{
	    	if(!checkName(name.val())){
				alert("医生真实姓名只能为汉字");
				name.focus();
				return false;
			}
	    }*/
	   if(!validTextareaLength('简介内容过长（最多100个字符）！')){
				return ;
			}
	     document.forms[0].submit();
	    
	}
	 function  modifyPic(id){
       $("#modifyPic").html('<input type="file" name="imgFile" id="img"/>&nbsp;&nbsp;&nbsp;<input type="button" value="取消" onclick="movePic()"/>');
       $('#'+id).hide();
   }
   function  movePic(){
      var picbtn=document.getElementById("picbtn");
      $("#modifyPic").html('');
      picbtn.style.display='inline';
   }
	</script>
	<body>
	<form action="<%=basePath%>doctor/save.action" method="post" id="myform" name="myform" enctype="multipart/form-data"> 
	<div align="center">
	<table width="80%" border="0" cellspacing="1" cellpadding="5" class="tabCls" style="margin-top: 10px;">
		<tr>
			<td colspan="4" align="center" bgcolor="#ffffff">
				<span style="font-size: 25px; font: ; font-weight: bold;">医生信息维护</span>&nbsp;<font color='red'>(*为必填项)</font>
			</td>
		</tr>
	</table>
		<table width="90%" border="0" style="margin-top: 10px;">
			
			<tr>
				<td align="right" class="tdT tdR tdL" width="20%">真实姓名：</td>
				<td colspan="4" class="tdT tdR" width="100%" align="left"><input id="realName" type="text" maxlength="5" size="15" value="<s:property value="doctors.realName"/>" name="doctors.realName">&nbsp;<font color='red'>*</font></td>
			</tr>
			<tr>
				<td align="right" class="tdT tdR tdL" width="20%">职称：</td>
				<td colspan="4" class="tdT tdR" width="100%" align="left">
				 	<SELECT id="dlevel" name="doctors.dlevel" class="loginInput"></SELECT>
				 	<input  id="dlevelvalue" type="hidden" value="<s:property value="doctors.dlevel"/>">
			</tr>
			<tr>
				<td align="right" class="tdT tdR tdL" width="20%">性别：</td>
				<td colspan="4" class="tdT tdR" width="100%" align="left"><s:radio list="#{'0':'男','1':'女'}"   name="doctors.sex"  
											theme="simple" /></td>
			</tr>
			<tr>
				<td align="right" class="tdT tdR tdL" width="20%">手机：</td>
				<td colspan="4" class="tdT tdR" width="100%" align="left"><input id="phone" type="text" maxlength="11" size="15" value="<s:property value="doctors.phone"/>" name="doctors.phone"></td>
			</tr>
			<tr>
				<td align="right" class="tdT tdR tdL " >图片：</td>
				<c:if test="${doctors.imgsrc != null}">
				<td align="left"  colspan="4">
					<img src="<%=basePath%>${doctors.imgsrc}" id="img" width="149" height="92"/>&nbsp;<a href="<%=basePath%>${doctors.imgsrc}" target="_blank"/>浏览原图</a>&nbsp;&nbsp;&nbsp;<span id="picbtn">	<s:if test="flag==1"><input type="button"  onclick="modifyPic('picbtn')" value="修改"/></s:if></span>
				     <div id="modifyPic"></div>
				     <input type="hidden" name="doctors.imgsrc" value='<s:property value="doctors.imgsrc" />'>
				</td>
				</c:if>
				<c:if test="${doctors.imgsrc == null}">
				<td align="left"  colspan="4">
					<input type="file" name="imgFile" id="img" size="69"/>  
				</td>
				</c:if>
			</tr>
			<tr>
				<td align="right" class="tdR tdL   tdT">简介：</td>
				<td class="tdR   tdT" colspan="4">
				<textarea style="width:770px;height:100px;word-wrap:break-word;" onkeyup="if(this.value.length>100){alert('输入内容过长');this.style.border='double red';return false}else{this.style.border='1px #D4D0C8 solid';}" name="doctors.summary" id="content1"><s:property value="doctors.summary" /></textarea>
				</td>
			</tr>
			<tr>
				<td align="right" class="tdR tdL tdB tdT">描述：</td>
				<td class="tdR tdB tdT" colspan="4">
				<textarea style="width:770px;height:300px;word-wrap:break-word;" name="doctors.description" id="content"><s:property value="doctors.description" /></textarea>
				</td>
			</tr>
		</table>
		
		
		<input type="hidden" id="hid" name="doctors.hid" value="<s:property value="doctors.hid"/>"/>
		<input type="hidden" id="did" name="doctors.did" value="<s:property value="doctors.did"/>"/>
		<input type="hidden" id="gid" name="doctors.gid" value="<s:property value="doctors.gid"/>"/>
		<input type="hidden" id="id" name="doctors.id" value="<s:property value="doctors.id"/>"/>
		<table width="80%" class="tabCls">
		<tr>
			<td align="center">
			<s:if test="flag==1">
				<input type="button" id="save" name="Submit" value="保 存" 
					onClick="checkForm()" class="button_sty saveBtn" />
			</s:if>		
				<input type="button" id="reset" name="reset" value="返 回"
						onClick="goBackReset()" class="button_sty backBtn" />
			</td>
		</tr>
	</table>
	</div>
	</form>
	</body>
	<script type="text/javascript">
		var editor;
        KindEditor.ready(function(K) {
		               editor = K.create('#content', {
		               allowFileManager : true,
		               uploadJson : '../scripts/kindeditor-4.1/upload_json.jsp',
				       fileManagerJson : '../scripts/kindeditor-4.1/file_manager_json.jsp',
				          afterBlur:function(){ 
				            this.sync(); 
				        },  
                       items : [
					 	           'preview','source', '|', 'undo', 'redo', '|',  'cut', 'copy', 'paste',
						        'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
						        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
						        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
						        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
						        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
						       'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',
						        'link', 'unlink'
                  ]
                        
                });
        });
		var dlevelValue = '${doctors.dlevel}';
		$.get('../dataPlugin/buildJsonData.action?tablename=title_type',function(mes){
			var mesJson = eval('('+mes+')');
			var disJson = mesJson[0]['result'];
			initSelect('dlevel',disJson,dlevelValue,function(){});
		})
		
		
		
	</script>
	
	
	
</html>
